﻿using System;
using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema;
using Volo.Abp.Domain.Entities;

namespace HCMS.Entities.Manage
{
    /// <summary>
    /// 管理员
    /// </summary>
    [Table("admin")]
    public class Admin : Entity<int>
    {
        /// <summary>
        /// Id
        /// </summary>
        public new int Id { get; set; }

        /// <summary>
        /// 创建 时间
        /// </summary>
        [Column("create_time")]
        public DateTime CreateTime { get; set; } = DateTime.Now;

        /// <summary>
        /// 创建 人
        /// </summary>
        [Column("create_user")]
        public string CreateUser { get; set; } = "";

        /// <summary>
        /// 更新 时间
        /// </summary>
        [Column("update_time")]
        public DateTime UpdateTime { get; set; } = DateTime.Now;

        /// <summary>
        /// 更新 人
        /// </summary>
        [Column("update_user")]
        public string UpdateUser { get; set; } = "";

        /// <summary>
        /// 状态
        /// </summary>
        [Column("status")]
        public int Status { get; set; }

        /// <summary>
        /// 头像
        /// </summary>
        [Column("logo")]
        public string Logo { get; set; } = "";

        /// <summary>
        /// 姓名
        /// </summary>
        [Required(ErrorMessage = "请填写 姓名")]
        [Column("admin_name")]
        public string AdminName { get; set; } = "";

        /// <summary>
        /// 密码
        /// </summary>
        [Required(ErrorMessage = "请填写 密码")]
        [Column("admin_password")]
        public string PassWord { get; set; } = "";

        /// <summary>
        /// 密码 盐
        /// </summary>
        [Column("password_salt")]
        public string Salt { get; set; } = "";

        /// <summary>
        /// 当前 登录 时间
        /// </summary>
        [Column("login_current_time")]
        public DateTime LoginCurrentTime { get; set; } = DateTime.MinValue;

        /// <summary>
        /// 当前 登录 IP
        /// </summary>
        [Column("login_current_ip")]
        public string LoginCurrentIp { get; set; } = "";

        /// <summary>
        /// 当前 登录 浏览器
        /// </summary>
        [Column("login_current_brower")]
        public string LoginCurrentBrower { get; set; } = "";

        /// <summary>
        /// 上次 登录 时间
        /// </summary>
        [Column("login_last_time")]
        public DateTime LoginLastTime { get; set; } = DateTime.MinValue;

        /// <summary>
        /// 上次 登录 IP
        /// </summary>
        [Column("login_last_ip")]
        public string LoginLastIp { get; set; } = "";

        /// <summary>
        /// 上次 登录 浏览器
        /// </summary>
        [Column("login_last_brower")]
        public string LoginLastBrower { get; set; } = "";

        /// <summary>
        /// 登录 次数
        /// </summary>
        [Column("login_num")]
        public int LoginNum { get; set; }

        /// <summary>
        /// 允许查看 Api 文档
        /// </summary>
        [Column("use_api_doc")]
        public bool UseApiDoc { get; set; }
    }
}
